﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// TheoDoiThiDua Repository. Good example of CRUD operations.
    ///// </summary>
    public class TheoDoiThiDuaRepository : ITheoDoiThiDuaRepository
    {
        private static readonly ITheoDoiThiDuaDao _theoDoiThiDua = DataAccess.TheoDoiThiDuaDao;
        public List<TheoDoiThiDua> GetList()
        {
            return _theoDoiThiDua.GetTheoDoiThiDua().ToList();
        }

        public TheoDoiThiDua Get(string id)
        {
            return _theoDoiThiDua.GetTheoDoiThiDuaByID(id);
        }

        public void Insert(TheoDoiThiDua t)
        {
            _theoDoiThiDua.InsertTheoDoiThiDua(t);
        }

        public void Update(TheoDoiThiDua t)
        {
            _theoDoiThiDua.UpdateTheoDoiThiDua(t);
        }

        public void Delete(TheoDoiThiDua t)
        {
            _theoDoiThiDua.DeleteTheoDoiThiDua(t);
        }

        public List<TheoDoiThiDua> GetTheoDoiThiDuaBySchoolIdAndSchoolYear(string SchoolYear,int schoolId)
        {
          return   _theoDoiThiDua.GetTheoDoiThiDuaBySchoolIdAndSchoolYear(SchoolYear,schoolId);
        }
    }
}